package org.jl.demo.authority.model.po;

import lombok.Data;
import jakarta.persistence.*;

/**
 * 组织Po
 */
@Data
@Entity
@Table(name = "z_group", indexes = {
        @Index(name = "idx_parent_id", columnList = "parent_id"),
        @Index(name = "idx_group_code", columnList = "group_code"),
        @Index(name = "idx_group_name", columnList = "group_name")
})
public class Group {
    /**
     * 组织ID
     */
    @Id
    @Column(name = "id", nullable = false, unique = true)
    private Integer id;
    /**
     * 组织父ID
     */
    @Column(name = "parent_id", nullable = false)
    private Integer parentId;
    /**
     * 组织编码
     */
    @Column(name = "group_code", nullable = false, length = 8)
    private String groupCode;
    /**
     * 组织名称
     */
    @Column(name = "group_name", nullable = false, length = 32)
    private String groupName;
}